// Place your application-specific JavaScript functions and classes here
// This file is automatically included by javascript_include_tag :defaults

var Hotrod = {
  'build_grid': function(parent_element, columns, data) {
    var tbody = new Element('table').update(new Element("tbody"));
    var col_content = columns.map(function(e) {
      return "<th>"+e+"</th>";}
    ).join("");
    var tr = tbody.update(new Element('tr'))
    tr.update(col_content);
    $(parent_element).update(tbody);
  }
};